<?php /* Smarty version Smarty-3.1.12, created on 2013-04-12 12:33:14
         compiled from "C:\wamp\www\cm\templates\cash\add.tpl" */ ?>
<?php /*%%SmartyHeaderCode:117325167ff0a607e24-73594205%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'd65ddccb6d946cea50d1c212919f42c83c09755c' => 
    array (
      0 => 'C:\\wamp\\www\\cm\\templates\\cash\\add.tpl',
      1 => 1365767107,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '117325167ff0a607e24-73594205',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'data' => 0,
    'user' => 0,
    'type' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_5167ff0a6f0003_66711845',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5167ff0a6f0003_66711845')) {function content_5167ff0a6f0003_66711845($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include 'C:\\wamp\\www\\cm\\libs\\smarty\\libs\\plugins\\modifier.date_format.php';
?><?php echo $_smarty_tpl->getSubTemplate ($_smarty_tpl->tpl_vars['data']->value['pathToError'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<script type="text/javascript">
    
        
    function showSecondUser(type){
        var both = "<?php echo $_smarty_tpl->tpl_vars['data']->value['bothMovesOfCash'];?>
";
        if (type==both){
            $("#secondUser").show();
        } else {
            $("#secondUser").hide();
        }
    }
        
    $(document).ready(function() {
        $(".float").change(function() {
            makeFloat(".float");
        });
        $("#date").datepicker({ 
            dateFormat: "dd/mm/yy",
            firstDay: 1     
        });
    });
    
</script>
<h2 class="pageTitle">Add entry into cash</h2>
<form class="adding" action="<?php echo $_smarty_tpl->tpl_vars['data']->value['root'];?>
?input=add_entry" method="post" onsubmit="return checkAdd_entry(
                                                                    $('#date').val(), 
                                                                    $('#amount').val(),
                                                                    $('#description').val()
                                                                                   )">
    <table class="tableForm">
        <tr>
            <td>
                <label for="user">User<span class="red">*</span> </label>
            </td>
            <td>
                <select name="entry[user]" id="user" size="1">
                    <?php  $_smarty_tpl->tpl_vars['user'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['user']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['recipients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['user']->key => $_smarty_tpl->tpl_vars['user']->value){
$_smarty_tpl->tpl_vars['user']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['user']->key;
?>
                        <option <?php if ($_smarty_tpl->tpl_vars['user']->value['users_id']==$_SESSION['user']['user_id']){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['user']->value['users_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['user']->value['surname'];?>
, <?php echo $_smarty_tpl->tpl_vars['user']->value['name'];?>
</option>
                    <?php } ?>
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <label for="date">Date <span class="red">*</span> </label>
            </td>
            <td>
                <input name="entry[date]" id="date" type="text" value="<?php echo smarty_modifier_date_format(time(),"%d/%m/%Y");?>
" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="amount">Amount<span class="red">*</span> </label>
            </td>
            <td>
                <input name="entry[amount]" id="amount" type="text" class="float" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="moveType">Type of move<span class="red">*</span> </label>
            </td>
            <td>
                <select name="entry[moveType]" id="moveType" size="1" onchange="showSecondUser(this.value)">
                    <?php  $_smarty_tpl->tpl_vars['type'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['type']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['cash_types']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['type']->key => $_smarty_tpl->tpl_vars['type']->value){
$_smarty_tpl->tpl_vars['type']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['type']->key;
?>
                        <option <?php if ($_smarty_tpl->tpl_vars['type']->value['Id']==1){?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['type']->value['Id'];?>
"><?php echo $_smarty_tpl->tpl_vars['type']->value['TypPohybu'];?>
</option>
                    <?php } ?>
                </select>
            </td>
        </tr>
        <tr id="secondUser" style="display: none">
            <td>
                <label for="recipient">Recipient<span class="red"></span> </label>
            </td>
            <td>
                <select name="entry[recipient]" id="recipient" size="1">
                    <?php  $_smarty_tpl->tpl_vars['user'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['user']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['data']->value['recipients']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['user']->key => $_smarty_tpl->tpl_vars['user']->value){
$_smarty_tpl->tpl_vars['user']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['user']->key;
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['user']->value['users_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['user']->value['surname'];?>
, <?php echo $_smarty_tpl->tpl_vars['user']->value['name'];?>
</option>
                    <?php } ?>
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <label for="description">Description <span class="red">*</span></label>
            </td>
            <td>
                <textarea cols="30" rows="5" name="entry[description]" id="description"></textarea>
            </td>
        </tr>
        <?php if ($_SESSION['user']['user_type_id']==@USER_TYPE_ADMIN){?>
        <tr>
            <td>
                <label for="s">S</label>
            </td>
            <td>
                <input name="entry[s]" id="s" type="checkbox" value="1" />
            </td>
        </tr>
        <?php }?>
        <tr class="submitRow">
            <td>
                <input name="action" value="add_entry" type="hidden" />
            </td>
            <td>
                <input type="submit" value="Add entry" name="add_entry" /> &nbsp; 
                <span class="red">* Required</span>
            </td>
            <td></td>
        </tr>
    </table>
</form><?php }} ?>